<?php
use common\controllers\PCAccountController;
/**
 * 爱聚公用控制器
 * @author duanlang<duanlang@iyene.com>
 * @reviewer author<xxxx@iyene.com>
 * 爱聚基础控制器基类，一些公用的常用的用的地方比较多的方法放在本地方
 *
 * @property Wechat_service $wechat_service
 */
class WECHATAPI_Controller extends PCAccountController
{
    /**
     * @var App\libraries\WeChat\WeChat
     */
    public $weChat;

    //构造函数
    function __construct() {
        parent::__construct();

        //检测微信账号信息
        $this->load->service('wechat_service');
        $wechatInitializeResult = $this->wechat_service->weChatInitialize($this->company_id, $this->wechatApp->getAppId());
        if($wechatInitializeResult['code'] > 0) {
            $this->response($wechatInitializeResult['code'], $wechatInitializeResult['data']);
        }
        $this->weChat = $wechatInitializeResult['data'];
    }

}